okaerifandomcom-20200214-history
Build Instructions
This page contains instructions on how to compile a fairly useful Aegisub by yourself for the Windows operating system. For Linux, FreeBSD and other UNIX-based systems, please see Unix Instructions. This is a fairly complex process, but required if you plan to stay ahead of SVN snapshots or contribute to the project by sending patches. The repository is located at https://spaceboyz.net/svn/aegisub/trunk/. If you have any issues building Aegisub, please drop us a line in the official IRC channel. Requirements Aegisub requires the following to compile on Windows: * Microsoft Visual C++ 2005 SP1 * wxWidgets 2.8.7 built with OpenGL support * wxSTC (included with wxWidgets in contrib/ directory) * Hunspell 1.1.12 (1.2.1 doesn't work) * DirectX Software Development Kit * Microsoft® Windows® Software Development Kit for Windows Vista™ and .NET Framework 3.0 Runtime Components * Freetype 2.3.5 * inttypes.h and stdint.h Obtaining the source We recommend you to use the TortoiseSVN client. This guide assumes that you use it. * Download TortoiseSVN and install it. * Create an empty folder somewhere for the Aegisub project and binaries. * On that folder, create an empty "src" folder. * Right click that "src" folder, choose "SVN Checkout", and check out the url "https://spaceboyz.net/svn/aegisub/trunk/". If everything goes well, you'll see a list of files being downloaded. After it finishes, you're done getting the source. Building dependencies wxWidgets First of all, you need to build wxWidgets: * Get the latest release of wxWidgets 2.8.7 (wxMSW) and install it. * Add a WX environment variable on your system pointing to the location where you installed wxWidgets. It isn't necessary to have this environment variable setup, however it is highly recommended so it makes things easier. This will make possible to refer to your wxWidgets installation directory as %WX% on Windows and $(WX) on MSVC++. To setup the WX environment variable by hand follow these steps: ** Close all instances of Visual C++ or your new environment variables will not be available until you restart Visual C++. ** Right-click on My Computer and open the Properties window. ** Switch to the Advanced tab and click the Environment Variables button. ** Under the 'User variables' section, click New. ** For name, type "WX", and for value, type the full location where you installed wxWidgets to (typically "C:\wxWidgets-x.x.x\"). **Click OK on all dialogs to save your settings. * Open the workspace file located under the "%WX%\build\msw" folder. * Locate its configuration setup.h header (usually at "%WX%\include\wx\msw") and enable OpenGL and Unicode support on it (by setting wxUSE_GLCANVAS and wxUSE_UNICODE to 1). * Build both "Unicode Release" and "Unicode Debug" versions. * Open the workspace file at "%WX%\contrib\build\stc" and build both "Unicode Release" and "Unicode Debug" versions * On MSVC++, go to "Tools"->"Options"->"Projects and Solutions"->"VC++ Directories" and add the wxWidgets library folder to the list of Library paths (typically, "$(WX)\lib\vc_lib") and the include folder (usually "$(WX)\include") to the list of Include paths. FreeType * Get the latest release of FreeType and open the solution file at "\builds\win32\visualc" and build both Release Multithreaded and Debug Multithreaded. * Copy the generated libs to your VC\lib directory and the include folder to your VC directory (the whole include folder, consisting of a freetype folder and a ft2build.h file). Hunspell * Get Hunspell and open the solution file at "\src\win_api" and build both Release and Debug versions. * Rename the debug lib to libhunspelld.lib * Copy all the headers from "\src\hunspell" to your VC\include\hunspell directory and the generated libs to your VC\lib directory. Baseclasses * Goto File->Open->Project/Solution. Locate the baseclasses.sln solution file in the "Program Files\Microsoft SDKs\Windows\v6.0\Samples\Multimedia\DirectShow\BaseClasses" folder. * In the Solution Explorer window (upper left), right click on the BaseClasses project and select Properties. * Now in the upper left you will see a dropdown entitled Configuration. Select All Configurations and make the following two changes. ** Under Configuration Properties->General. Change Use of MFC to Use MFC in a Static Library. ** Under Librarian->General add winmm.lib in Additional Depedencies. * Now under each configuration type individually (Debug, Debug Unicode, Release, Release Unicode) goto Librarian->General and change the output name to agree with the configuration type. ** strmbased.lib (Debug) ** strmbasedu.lib (Debug Unicode) ** STRMBASER.lib (Release) ** STRMBASERU.lib (Release Unicode) * You should be able to see the D is for Debug, RU for Release Unicode, etc. After applying those changes by pressing ok, go back into the Project's Properties window. Confirm that under C/C++->Code Generation the Runtime Library is set to Multi-threaded Debug (/MTd) for Debug/Debug Unicode, and Multi-threaded (/MT) for Release/Release Unicode. Changing the Use of MFC option should have already forced these to be correct, however this is just to double check, as it is a very important option that needs to be set correctly. * Now right click the Solution 'baseclasses' and select Batch Build. Click Select All and Build. Compiling all four shouldn't take too long. If you get any errors, review the above again. After they are complete you will see four folders in the "Baseclasses" folder for each configuration type. Copy the "strmbas*.lib" file from each folder and place them into a new folder called "Lib". The full path of which should now be "Program Files\Microsoft SDKs\Windows\v6.0\Samples\Multimedia\DirectShow\BaseClasses\Lib". * Back in the VC++ Directories settings. Under Include files add: ** "Program Files\Microsoft SDKs\Windows\v6.0\Samples\Multimedia\DirectShow\BaseClasses" ** Under Library files add: ** "Program Files\Microsoft SDKs\Windows\v6.0\Samples\Multimedia\DirectShow\BaseClasses\Lib" Building Aegisub * Create a blank "Win32 Application" project in Visual Studio. We recommend you to put it on the folder above the one where you checked out the source. * Add all the .h, .cpp and .rc files in the "Aegisub" folder (but NOT in any sub-folders of it) to the project. ** Only add the "auto4_ruby" files if you have Ruby 1.9 libraries and want Ruby support. ** Only add the "auto4_auto3" files if you want Automation 3 support, also see the instructions below then. ** Only add the audio_player_openal.cpp, audio_player_portaudio.cpp or audio_player_pulse.cpp if you want OpenAL, PortAudio or PulseAudio support. You probably won't need them on Windows, DirectSound is good enough. ** Only add the "lavc" files if you plan on building Aegisub with FFMpeg support. ** Do not add audio_player_alsa.cpp, this is only for the Linux builds. * Add the Lua project located inside the aegisub folder to the solution, and set the Aegisub project to depend on it. * Go into the project settings, and set the following options: ** (All Configurations) Set "Character Set" (Under "General") to "Use Unicode Character Set" ** (All Configurations) On the same place, set "Detect 64-bit Portability Issues" to "No" ** (Release) On the same place, add "$(WX)\include" and "$(WX)\lib\vc_lib\mswu" as Additional Include Directories" ** (Debug) Add "$(WX)\include" and "$(WX)\lib\vc_lib\mswud" as Additional Include Directories" ** (Release) Set "Code Generation" (Under "C/C++", "General") to "Multi-threaded DLL" ** (Debug) Set "Code Generation" to "Multi-threaded Debug DLL" ** (All Configurations) On "C/C++", "Advanced", set "Disable Specific Warnings" to "4906;4100" * Compile! Automation 3 Because of various incompatibilities between Lua 5.1 (used for Automation 4/Lua) and 5.0 (used for Automation 3) much of the Automation 3 logic has been moved to a separate DLL file. This DLL must be built with Microsoft Visual C++ .NET 2003, Visual C++ 2005 seems to generate wrong code for Lua 5.0. For convenience, there is a pre-built DLL with import library file for download. (This DLL should change very little now, it seems to work properly. Last updated 2007-06-19 for working config dialog support.) To get Automation 3 support: * Build or download "aegisub-auto3.dll", the sources along with a VC 2003 project file are in the "auto3" folder. * Add "auto4_auto3.cpp" and "auto4_auto3.h" to your Aegisub project. * In the properties for "auto4_lua.cpp", for All Configurations, under Preprocessor, add this to Preprocessor Definitions: WITH_AUTO3=1 * Add aegisub-auto3.lib to your libraries list for both Debug and Release configurations